package com.define.ssh.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.define.ssh.dao.TbLogDao;
import com.define.ssh.model.TbLog;
import com.define.ssh.service.TbLogService;

/**
 * 系统日志 业务实现类
 * 
 */
@Service("tbLogServiceImpl")
public class TbLogServiceImpl extends BaseServiceImpl<TbLog, Long> implements
		TbLogService {

	@Resource(name = "tbLogDaoImpl")
	private TbLogDao tbLogDao;

	@Resource(name = "tbLogDaoImpl")
	public void setBaseDao(TbLogDao tbLogDao) {
		super.setBaseDao(tbLogDao);
	}

	@Override
	public void saveSysLog(String module, String username, String content,
			String type, String ipaddr, String remark) {
		final TbLog tl = new TbLog();
		tl.setModule(module);
		tl.setUsername(username);
		tl.setLcontent(content);
		tl.setCreateDate(new Date());
		tl.setLtype(type);// 系统操作
		tl.setIpaddr(ipaddr);
		tl.setRemark(remark);
		this.save(tl);
	}

}
